package cn.bgs.pojo;


import cn.bgs.utils.DateUtils;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;


public class Student {

  private Integer stuId;
  private Integer stuNum;
  private String stuName;
  private String mobile;
  private String sex;
  private Integer age;
  private String idType;
  private String idNum;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private Date birthday;
  private Integer deleteFlag;
  private String nativePlace;
  private Integer provincesId;
  private Integer citiesId;
  private Integer areasId;
  private String detailAddr;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private Date createDate;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private Date updateDate;
  private String remark;

  private String province;
  private String area;
  private String city;

  private Cities cities1;
  private Provinces provinces1;
  private Areas areas1;

  private List<Cities> cities;
  private List<Provinces> provinces;
  private List<Areas> areas;

  public Cities getCities1() {
    return cities1;
  }

  public void setCities1(Cities cities1) {
    this.cities1 = cities1;
  }

  public Provinces getProvinces1() {
    return provinces1;
  }

  public void setProvinces1(Provinces provinces1) {
    this.provinces1 = provinces1;
  }

  public Areas getAreas1() {
    return areas1;
  }

  public void setAreas1(Areas areas1) {
    this.areas1 = areas1;
  }

  public List<Cities> getCities() {
    return cities;
  }

  public void setCities(List<Cities> cities) {
    this.cities = cities;
  }

  public List<Provinces> getProvinces() {
    return provinces;
  }

  public void setProvinces(List<Provinces> provinces) {
    this.provinces = provinces;
  }

  public List<Areas> getAreas() {
    return areas;
  }

  public void setAreas(List<Areas> areas) {
    this.areas = areas;
  }

  public String getProvince() {
    return province;
  }

  public void setProvince(String province) {
    this.province = province;
  }

  @Override
  public String toString() {
    return "Student{" +
            "stuId=" + stuId +
            ", stuNum=" + stuNum +
            ", stuName='" + stuName + '\'' +
            ", mobile='" + mobile + '\'' +
            ", sex='" + sex + '\'' +
            ", age=" + age +
            ", idType='" + idType + '\'' +
            ", idNum='" + idNum + '\'' +
            ", birthday=" + birthday +
            ", deleteFlag=" + deleteFlag +
            ", nativePlace='" + nativePlace + '\'' +
            ", provincesId=" + provincesId +
            ", citiesId=" + citiesId +
            ", areasId=" + areasId +
            ", detailAddr='" + detailAddr + '\'' +
            ", createDate=" + createDate +
            ", updateDate=" + updateDate +
            ", remark='" + remark + '\'' +
            ", province='" + province + '\'' +
            ", area='" + area + '\'' +
            ", city='" + city + '\'' +
            '}';
  }

  public String getArea() {
    return area;
  }

  public void setArea(String area) {
    this.area = area;
  }

  public String getCity() {
    return city;
  }

  public void setCity(String city) {
    this.city = city;
  }

  public Integer getStuId() {
    return stuId;
  }

  public void setStuId(Integer stuId) {
    this.stuId = stuId;
  }

  public Integer getStuNum() {
    return stuNum;
  }

  public void setStuNum(Integer stuNum) {
    this.stuNum = stuNum;
  }

  public String getStuName() {
    return stuName;
  }

  public void setStuName(String stuName) {
    this.stuName = stuName;
  }

  public String getMobile() {
    return mobile;
  }

  public void setMobile(String mobile) {
    this.mobile = mobile;
  }

  public String getSex() {
    return sex;
  }

  public void setSex(String sex) {
    this.sex = sex;
  }

  public Integer getAge() {
    int age = 0;
    try{
      age = DateUtils.getAge(birthday);
    }catch (Exception e){
        e.printStackTrace();
    }
    return age;
  }

  public void setAge(Integer age) {
    this.age = age;
  }

  public String getIdType() {
    return idType;
  }

  public void setIdType(String idType) {
    this.idType = idType;
  }

  public String getIdNum() {
    return idNum;
  }

  public void setIdNum(String idNum) {
    this.idNum = idNum;
  }

  public Date getBirthday() {
    return birthday;
  }

  public void setBirthday(Date birthday) {
    this.birthday = birthday;
  }

  public Integer getDeleteFlag() {

    return deleteFlag;
  }

  public void setDeleteFlag(Integer deleteFlag) {
    this.deleteFlag = deleteFlag;
  }

  public String getNativePlace() {
    nativePlace=""+provinces1.getProvince()+cities1.getCity()+areas1.getArea();
    return nativePlace;
  }

  public void setNativePlace(String nativePlace) {
    this.nativePlace = nativePlace;
  }

  public Integer getProvincesId() {
    return provincesId;
  }

  public void setProvincesId(Integer provincesId) {
    this.provincesId = provincesId;
  }

  public Integer getCitiesId() {
    return citiesId;
  }

  public void setCitiesId(Integer citiesId) {
    this.citiesId = citiesId;
  }

  public Integer getAreasId() {
    return areasId;
  }

  public void setAreasId(Integer areasId) {
    this.areasId = areasId;
  }

  public String getDetailAddr() {
    return detailAddr;
  }

  public void setDetailAddr(String detailAddr) {
    this.detailAddr = detailAddr;
  }

  public Date getCreateDate() {
    return createDate;
  }

  public void setCreateDate(Date createDate) {
    this.createDate = createDate;
  }

  public Date getUpdateDate() {
    return updateDate;
  }

  public void setUpdateDate(Date updateDate) {
    this.updateDate = updateDate;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }
}
